package com.gsm.controller;

import com.gsm.dto.RegisterUserDto;
import com.gsm.entity.Result;
import com.gsm.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("register")
public class RegisterController {
    @Autowired
    private RegisterService registerService;

    @PostMapping("user")
    public Result insertUserInfo(@Valid @RequestBody RegisterUserDto dto) {
        Result result = registerService.insertUserInfo(dto);
        return result;
    }
}
